import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

export default defineConfig({
  plugins: [vue({})],
  root: path.resolve(__dirname, '.'),
  build: {
    outDir: path.resolve(__dirname, '../../out/dist/main_page'),
    emptyOutDir: true,
    rollupOptions: {
      input: {
        // 明确指定入口 HTML 路径（默认是项目根目录的 index.html）
        main: path.resolve(__dirname, 'index.html')
      },
      output: {
        entryFileNames: 'main.js',
        assetFileNames: 'assets/[name].[ext]'
      }
    }
  }
})